package com.wang.validator.dto;

import com.wang.validator.config.GroupAdd;
import com.wang.validator.config.GroupUpdate;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * @author: wangning
 * @date: 2024/1/2 15:58
 */
@Data
public class UserDTO {

    @NotNull(message = "用户id不能为空", groups = GroupAdd.class)
    private Integer id;

    @NotEmpty(message = "用户名add不能为空", groups = GroupAdd.class)
    @NotEmpty(message = "用户名update不能为空", groups = GroupUpdate.class)
    private String name;

    @NotBlank(message = "邮箱不能为空", groups = {GroupAdd.class, GroupUpdate.class})
    @Email(message = "邮箱格式不正确", groups = {GroupAdd.class, GroupUpdate.class})
//    @Length(max = 6, message = "用户名长度不能超过6")
    private String email;

}
